;;(import 
;;  '(javax.swing JFrame JPanel JLabel JButton BorderFactory GroupLayout GroupLayout$Alignment)
;;  '(java.awt.event ActionEvent ActionListener)
;;  '(java.awt Dimension)
;;  )

(import '(javax.swing JFrame JLabel JTextField JButton GroupLayout GroupLayout$Alignment SwingConstants JPanel BorderFactory)
        '(java.awt.event ActionListener)
        '(java.awt Component Dimension))

(def jb
  (doto (new JButton "Hi there")
    (.addActionListener 
      (proxy [ActionListener] []
        (actionPerformed [e] (println "Button Pressed"))))))

(def jp 
  (doto (new JPanel)
    (.setPreferredSize (new Dimension 500 500))
    (.setBorder (BorderFactory/createTitledBorder "Panel Area"))))

(def jf (new JFrame))
(def layout (new GroupLayout (.getContentPane jf)))

(doto layout
  (.setAutoCreateGaps true)
  (.setAutoCreateContainerGaps true)
  (.setHorizontalGroup
    (.. layout (createSequentialGroup)
      (addGroup
        (.. layout (createParallelGroup GroupLayout$Alignment/LEADING)
          (addComponent jp)
          (addComponent jb)))))
  (.setVerticalGroup
    (.. layout (createSequentialGroup)
      (addGroup
        (.. layout (createParallelGroup GroupLayout$Alignment/BASELINE)
          (addComponent jp)))
      (addGroup
        (.. layout (createParallelGroup GroupLayout$Alignment/LEADING)
          (addComponent jb))))))

(doto jf
    (.. getContentPane (setLayout layout))
    (.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)
    (.add (new JLabel "Hello World"))
    (.add jb)
    (.add jp)
    (.pack)
    (.setVisible true))



